package service

import (
	"context"

	"gitee.com/thewalkers/refactoring-code/model"
)

// AddEmployeeTransactionService acts as a struct for injecting an implementation of EmployeeRepository
// for use in service methods
type AddEmployeeTransactionService struct {
	AddEmployeeTransActionRepository model.AddEmployeeTransActionRepository
}

// AEConfig will hold repository that will eventually be injected into this
// service layer
type AEConfig struct {
	AddEmployeeTransActionRepository model.AddEmployeeTransActionRepository
}

// NewEmployeeService is a factory function for
// initializing a EmployeeService with its repository layer dependencies
func NewAddEmployeeTransactionService(a *AEConfig) model.AddEmployeeTransActionService {
	return &AddEmployeeTransactionService{
		AddEmployeeTransActionRepository: a.AddEmployeeTransActionRepository,
	}
}

func (a *AddEmployeeTransactionService) Create(ctx context.Context, e *model.Employee) error {
	return a.AddEmployeeTransActionRepository.Create(ctx, e)
}
